<template>
  <input type="text" v-model="inputValue" />
  <button @click="handleClick">提交</button>
  <ul>
    <li v-for="(item, index) in list" :key="index">{{ item }}</li>
  </ul>
</template>

<script setup>
import { ref } from "vue"
const inputValue = ref('')
const list = ref([])
const handleClick = () => {
  list.value.push(inputValue.value)
  inputValue.value = ''
}
</script>

<style lang="scss" scoped></style>
